<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/1/28 0028
 * Time: 0:51
 */

class people {

    /**
     * @param $age
     * @param $name
     */
    public function __construct($age,$name,$sex){//__construct构造方法，创建类的时候执行
       // echo 'str man';

        $this->_age=$age;
        $this->_name=$name;
        $this->_sex=$sex;

        if(people::$NUM>people::MAX_MAN_NUM){//
            throw new Exception('no!! ren');
        }
    }

    public function getAge(){//成员方法
        return $this->_age;
    }
    public function getName(){
        return $this->_name;
    }
    public function getSex(){
        return $this->_sex;
    }

    public function hi(){
        echo '11111111111111';
    }

    private $_age,$_name,$_sex;


    private static  $NUM =0;//静态变量
    const MAX_MAN_NUM=200;

    public static function  sayHelo(){//static静态类方法
        echo ' Hello man';
    }

}